import request from '@/utils/request'

// 查询订单信息列表
export function listOrder(query) {
  return request({
    url: '/oms/order',
    method: 'get',
    params: query
  })
}
// 查询我的订单信息列表
export function myListOrder(query) {
  return request({
    url: '/oms/order/myorder',
    method: 'get',
    params: query
  })
}
// 查询订单信息列表
export function pageOrder(query) {
  return request({
    url: '/oms/order/page',
    method: 'get',
    params: query
  })
}

// 查询订单信息详细
export function getOrder(orderId) {
  return request({
    url: '/oms/order/' + orderId,
    method: 'get'
  })
}


// 查询订单所有详情
export function getDetailOrder(orderId) {
  return request({
    url: '/oms/order/all-detail/' + orderId,
    method: 'get'
  })
}

// 新增订单信息
export function addOrder(data) {
  return request({
    url: '/oms/order',
    method: 'post',
    data: data
  })
}

// 修改订单信息
export function updateOrder(data) {
  return request({
    url: '/oms/order/'+data.orderId,
    method: 'put',
    data: data
  })
}
export function cancleOrder(orderId){
  return request({
    url:'/oms/order/cancel/'+orderId,
    method:'put',
  })
}
// 删除订单信息
export function delOrder(orderId) {
  return request({
    url: '/oms/order/' + orderId,
    method: 'delete'
  })
}
// 出车
export function lendOrder(orderId) {
  return request({
    url: '/oms/order/lend/' + orderId,
    method: 'put'
  })
}
// 还车
export function returnOrder(orderId) {
  return request({
    url: '/oms/order/return/' + orderId,
    method: 'put'
  })
}
